Skip to content

feat: Support for tracing ID headers#107

Open
Anush008 wants to merge 1 commit intocustom-headersfrom
tracing-ids
Open

feat: Support for tracing ID headers#107
Anush008 wants to merge 1 commit intocustom-headersfrom
tracing-ids

Conversation

@Anush008
Copy link
Member

@Anush008 Anush008 commented Mar 18, 2026

Built on top of #106

Context ctx = RequestHeaders.withHeader(Context.current(), "x-request-id", "abc-123");
ctx.run(() -> client.listCollectionsAsync());
Map<String, String> headers = new HashMap<>();
headers.put("x-request-id", "abc-123");
headers.put("x-tenant-id", "org-456");

Context ctx = RequestHeaders.withHeaders(Context.current(), headers);
ctx.run(() -> {
    client.upsertAsync("my-collection", points);
    client.queryAsync("my-collection", searchRequest, 10);
    // both carry x-request-id
});

static ClientInterceptor newInterceptor() {
return new ClientInterceptor() {
@Override
public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No way around this boilerplate 🙁

Signed-off-by: Anush008 <mail@anush.sh>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants